{t assignTo=title}Indexation{/t}
{include file="$MODULES_DIR/backoffice/templates/block/modal/ModalTitle.html" title=$title}
<div id="modalContent">
    <table class="modalTable">
		<tr><th>{backend_image file="ajax-loader-big.gif"}</th></tr>
		<tr><th>{t}Indexation in progress, please wait...{/t}</th></tr>
	</table>
    <table class="modalTableOk" style="width:100%; display: none;">
		<tr><th style="text-align: center; padding-top:10px;">{t}Indexation complete{/t}</th></tr>
	</table>
    <div id="error" style="display:none;">
        <div id="errormsg"></div>
        <div style="text-align:center"><input type="button" class="nyroModalClose closeButton" value="{t}Close{/t}"/></div>
    </div>
</div>
{include file="$MODULES_DIR/backoffice/templates/block/modal/ModalFooter.html" noButton='true'}

<script type="text/javascript">
    {literal}
        $(".nyroModalClose").hide();
        $.ajax(
        {
            {/literal}
            url: "{$URL_RELATIVE}/bo/index.php?module=searchEngine&action=AjaxIndexPages",
            {literal}
            async: true,
            success: function(result)
            {
               if(result=="ok")
               {
                  $(".modalTable").hide();
                  $(".nyroModalClose").show();
                  $(".modalTableOk").show();
               }
               else
               {
                  $(".modalTable").hide();
                  $("#errormsg").html(result);
                  width = $('#error').width()+18;
                  height = $('#error').height()+18;
                  $.nyroModalSettings({width:width, height:height});
                  $("#error").show()
               }
            }
        });
    {/literal}
</script>
